find duplicate characters from string in java and count its occurrence